<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$sqlmenu="select * from menu order by Orden asc";
$resmenu= cons_ins($sqlmenu);
?>
<div class="menu">
 <ul>
<?php while ($regMen=mysql_fetch_array($resmenu)):?>

     <li><a href="<?php echo utf8_encode($regMen['Url'])?>" class="bt1" target="<?php echo utf8_encode($regMen['Destino'])?>"><?php echo utf8_encode($regMen['Titulo'])?></a>
     <?php
     $sqlsmenu="select * from submenu where Menu=".$regMen['id']." order by Orden asc";
   
     $ressmenu= cons_ins($sqlsmenu);
     $numFilasSmenu = mysql_num_rows($ressmenu);
     echo "<ul>";
     if ($numFilasSmenu > 0){
        
         while ($reg=mysql_fetch_array($ressmenu)){
         echo ' <li><a href="'.utf8_encode($reg['Url']).'" target="'.utf8_encode($reg['Destino']).'">'.utf8_encode($reg['Titulo']).'</a></li>';
         
         }

     }
     echo "</ul>";
     ?>
         

     </li>
<?php
 
 endwhile ?>
</ul>
	</div>